<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>10绝对定位练习</title>
  <style>
    div{
      width: 300px;
      background-color: rgba(0,0,0,0.3);
        padding: 10px;
        position: relative;
    }
    input{
        border: 0;
        padding: 10px;
        width: 260px;
    }
    img{
        position: absolute;
        right: 40px;
        top: 13px;
    }
    p{
        font-size: 12px;
        margin:0;
        color: red;
    }
  </style>
</head>
<body>
    <div>
      <input type="text" value="请输入用户名" name="username" >
      <img src="user.png">
      <p>用户能不能为空!</p>
    </div>
</body>
</html>